/*****************************************************************************
 *   Copyright 2005 Tim A Wang
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 ****************************************************************************/
package com.jb.web.bean.content;

import com.jb.framework.PersistentContext;
import com.jb.web.bean.Region;
import com.jb.web.bean.inspector.FilePropertyEditor;
import com.jb.web.renderer.RenderKitImpl;


public class Video extends Region {
    static final long serialVersionUID = 123123L;

    static {
        publish(com.jb.web.bean.content.Video.class, GENERAL, "source", new FilePropertyEditor());
        publish(com.jb.web.bean.content.Video.class, GENERAL, "loop");
        publish(com.jb.web.bean.content.Video.class, GENERAL, "autoSize");
        publish(com.jb.web.bean.content.Video.class, GENERAL, "enableContextMenu");
        publish(com.jb.web.bean.content.Video.class, GENERAL, "showStatusBar");
        publish(com.jb.web.bean.content.Video.class, GENERAL, "showControls");
        publish(com.jb.web.bean.content.Video.class, GENERAL, "displaySize");
        RenderKitImpl.registerRenderer(Video.class, VideoRenderer.class);
    }

    String source;
    boolean autoSize;
    boolean displaySize;
    boolean enableContextMenu;
    boolean loop;
    boolean showControls;
    boolean showStatusBar;

    public void setAutoSize(boolean autoSize) {
        this.autoSize = autoSize;
    }

    public boolean isAutoSize() {
        return autoSize;
    }

    public void setDefault(PersistentContext pCtx) {
        super.setDefault(pCtx);
        setStyleClass("jbMovie");
        this.setSource("resources/movies/java_man.mpg");
    }

    public void setDisplaySize(boolean displaySize) {
        this.displaySize = displaySize;
    }

    public boolean isDisplaySize() {
        return displaySize;
    }

    public void setEnableContextMenu(boolean enableContextMenu) {
        this.enableContextMenu = enableContextMenu;
    }

    public boolean isEnableContextMenu() {
        return enableContextMenu;
    }

    public void setLoop(boolean loop) {
        this.loop = loop;
    }

    public boolean isLoop() {
        return loop;
    }

    public void setShowControls(boolean showControls) {
        this.showControls = showControls;
    }

    public boolean isShowControls() {
        return showControls;
    }

    public void setShowStatusBar(boolean showStatusBar) {
        this.showStatusBar = showStatusBar;
    }

    public boolean isShowStatusBar() {
        return showStatusBar;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getSource() {
        return source;
    }
}
